<?php
/**
 * Created by PhpStorm.
 * User: 12133
 * Date: 2025/7/14
 * Time: 17:35
 */

namespace app\model;


class User extends Base
{
    protected $append = [
        'image',
        'level_data'
    ];
    public function getLevelDataAttr($value,$data){
        $level = $data['level'] - 1;
        $data = Config::where('key','level_data')->value('value');
        $res = json_decode($data,true);
        foreach ($res AS $key => $value){
            if ($level == $key) return $value;
        }
        return $value;
    }
}